import { useState } from "react";

// let array = [
//     {id: 0, text: "aaa"},
//     {id: 1, text: "bbb"},
//     {id: 2, text: "ccc"},
//     {id: 3, text: "ddd"},
//     {id: 4, text: "eee"},
//     {id: 5, text: "fff"},
//     {id: 6, text: "ggg"},
//     {id: 7, text: "hhh"}
// ]

const ListView = (array) => {
    const [arr, setArr] = useState([])
    setArr(array)

    const listItem = (item) => {
        return(
            <div className="listItem" key={item.id}>
                {item.text}
            </div>
        )
    }
    return (
        <div className="list">
            {arr.map(item => (
                <div className="listItem" key={item.id}>
                    {item.text}
                </div>
            ))}
        </div>
    )
};
export default ListView